package com.maple.admin.user.dao;

import java.util.List;
import java.util.UUID;

import com.maple.admin.misc.paging.dto.PagingParamsDTO;
import com.maple.admin.user.dto.UserDTO;

/**
 * user maintenance DAO
 * @author luobenyu
 *
 */
public interface IAccountDAO {
	/**
	 * integration with shiro
	 * @param userName name from a shiro object as PrincipalCollection::getPrimaryPrincipal()
	 * @return a BaseUser object
	 */
	public UserDTO queryUserByLoginName(String userName) throws IndexOutOfBoundsException;
	
	/**
	 * query paginated user records
	 * @param paging
	 * @return
	 */
	public List<UserDTO> queryPaginatedUsers(PagingParamsDTO paging);
	
	/**
	 * fetch all users
	 * @return
	 */
	public List<UserDTO> queryAllUsers();
	
	/**
	 * check if user already exists
	 * @param userName
	 * @return
	 */
	public Boolean checkDuplicated(String userName);
	
	/**
	 * create a new user and return its credentials info
	 * @param newUser
	 * @return
	 */
	public UUID createUser(UserDTO newUser);
	
}
